package com.czz.Tool;

import java.io.InputStream;
import java.util.List;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import com.czz.Radio.Radio;

public class ConfigSAXParser {

	public static List<Radio> parseXml(InputStream inputStream) throws Exception {
		SAXParserFactory spf = SAXParserFactory.newInstance();
		SAXParser sp = spf.newSAXParser();
		ConfigXMLHandler handler = new ConfigXMLHandler();
		sp.parse(inputStream, handler);
		return handler.getRadioList();
	}
}
